
*******************************************************************************************************

**************INFODEMIC PATHWAYS: EVALUATING THE ROLE THAT TRADITIONAL****************
*****************AND SOCIAL MEDIA PLAY IN CROSS-NATIONAL INFORMATION TRANSFER****
******************REPLICATION CODE FOR SURVEY ANALYSIS****************

* Insert path name *

use ..../data/survey.dta

****VARIABLE CONSTRUCTION*****

**Region
recode Q5 1/4=1 5=2 6=3 7/10=4, gen(region)

*French
encode Q_Language, gen(french)

**Female
recode Q4 2=1 1=0 3=0, gen(female)

**Age
rename Q3 age
replace age = . if age<18
replace age = age/20

**Education
recode Q79 12=., gen(educ)
replace educ = (educ-1)/10

**Political Interest
rename Q14_1 interest 
replace interest = interest/10

**Knowledge
recode Q15 1=1 2/6=0, gen(know1)
recode Q16 1=0 2=1 3/5=0, gen(know2)
gen know3 = 0
replace know3 = 1 if Q58_2>Q58_1
gen know4 = 0
replace know4 = 1 if Q58_1>Q58_3

gen know = know1+know2+know3+know4
replace know = know/4

**News Exposure
egen newsexp = rowtotal(Q21_1-Q21_25)
gen lnewsexp = log(newsexp+1)
egen newsmax = max(lnewsexp)
replace lnewsexp = lnewsexp/newsmax

recode Q21_* (1=1)(else=0), gen(cbc ctv global city globe natpost torstar localnews tva tv5 lapres jdem jdeq ledev radiocan rebel natob tsun tyee postmil aptn tnn pressprog huff othout nooutlet)

**Social Media

*By application
egen socialexp = rowtotal(Q23_1-Q23_11)
gen lsocialexp = log(socialexp+1)
egen socialmax = max(lsocialexp)
replace lsocialexp = lsocialexp/socialmax

*Binned
recode lsocialexp 0=0 0.1/0.3=1 0.43/0.5=2 0.51/max=3, gen(socialcat)
replace socialcat = socialcat/3

*By frequency
recode Q24 1=5 2=4 3=3 4=2 5=1 6=0, gen(socialfreq)
replace socialfreq = socialfreq/5

**Political Discussion
recode Q29_1 1=0 2=1 3=2 4=3 5=4 6=., gen(discuss_fam)
recode Q29_2 1=0 2=1 3=2 4=3 5=4 6=., gen(discuss_friend)
recode Q29_3 1=0 2=1 3=2 4=3 5=4 6=., gen(discuss_work)

gen ftfdiscuss = (discuss_fam+discuss_friend+discuss_work)/3
replace ftfdiscuss = ftfdiscuss/4

**COVID Misperceptions
recode Q8_1 1=4 2=3 5=2 3=1 4=0, gen(vid_flu)
recode Q8_2 1=4 2=3 5=2 3=1 4=0, gen(vid_water)
recode Q8_3 1=4 2=3 5=2 3=1 4=0, gen(vid_bioweap)
recode Q8_4 1=4 2=3 5=2 3=1 4=0, gen(vid_homeo)
recode Q9_1 1=4 2=3 5=2 3=1 4=0, gen(vid_bats)
recode Q9_3 1=4 2=3 5=2 3=1 4=0, gen(vid_vitc)
recode Q9_4 1=4 2=3 5=2 3=1 4=0, gen(vid_pharma)
recode Q9_5 1=4 2=3 5=2 3=1 4=0, gen(vid_hightemp)

egen misinfo = rowmean(vid_flu vid_water vid_bioweap vid_homeo vid_bats vid_vitc vid_pharma vid_hightemp) 
replace misinfo = misinfo/4

**US News
recode Q244_* (1=1)(else=0), gen(nyt wapo wsj abc nbc cbs fox cnn msnbc breit dailykos npr politico atlantic bloomberg none)
gen usnews = nyt+wapo+wsj+abc+nbc+cbs+fox+cnn+msnbc+breit+dailykos+npr+ politico+atlantic+bloomberg
gen lusnews = log(usnews+1)
egen usmax = max(lusnews)
replace lusnews = lusnews/usmax

*Binned
recode lusnews 0=0 0.25=1 0.26/0.5=2 0.51/max=3, gen(uscat)
replace uscat = uscat/3

**************************************************

*****MAIN ANALYSES*****

**Table 1

sum nyt-none [aw=wgt]
sum cbc-nooutlet if french == 1 [aw=wgt]

**Table 2 and Figure

*H1B
reg misinfo lusnews lnewsexp ftfdiscuss know interest educ age female i.region [pw=wgt]
eststo A

*H2
reg misinfo c.lusnews##c.lsocialexp lnewsexp ftfdiscuss know interest educ age female i.region [pw=wgt]
eststo B
interactplot, sub(hist) scheme(plotplain) cme yline(0) bars(5) 
esttab A B, star(* 0.1 ** 0.05 *** 0.01) se(3) b(3) r2(2) nobase nogap wide nopa

**************************************************

*****SUPPLEMENTARY MATERIALS

**Table S3 - Binned
reg misinfo uscat lnewsexp ftfdiscuss know interest educ age female i.region [pw=wgt]
eststo A
reg misinfo c.uscat##c.socialcat lnewsexp ftfdiscuss know interest educ age female i.region [pw=wgt]
eststo B

esttab A B, star(* 0.1 ** 0.05 *** 0.01) se(3) b(3) r2(2) nobase nogap

**Table S4 - Social media frequency
reg misinfo lusnews lnewsexp ftfdiscuss know interest educ age female i.region [pw=wgt]
eststo A
reg misinfo c.lusnews##c.socialfreq lnewsexp ftfdiscuss know interest educ age female i.region [pw=wgt]
eststo B

esttab A B, star(* 0.1 ** 0.05 *** 0.01) se(3) b(3) r2(2) nobase nogap

**Table S5 - Extended Analysis
reg misinfo lsocialexp lnewsexp ftfdiscuss know interest educ age female i.region [pw=wgt] 
eststo A
reg lusnews lsocialexp lnewsexp ftfdiscuss know interest educ age female i.region [pw=wgt]
eststo B

esttab A B, star(* 0.1 ** 0.05 *** 0.01) se(3) b(3) r2(2) nobase nogap
